import 'package:json_annotation/json_annotation.dart';

part 'consultation_res.g.dart';

@JsonSerializable(fieldRename: FieldRename.none)
class ConsultationRes {
  final int? code;
  final Consultation? data;
  final String? msg;

  const ConsultationRes({
    this.code,
    this.data,
    this.msg,
  });

  factory ConsultationRes.fromJson(Map<String, dynamic> json) =>
      _$ConsultationResFromJson(json);

  Map<String, dynamic> toJson() => _$ConsultationResToJson(this);

  ConsultationRes copyWith({
    int? code,
    Consultation? data,
    String? msg,
  }) {
    return ConsultationRes(
      code: code ?? this.code,
      data: data ?? this.data,
      msg: msg ?? this.msg,
    );
  }
}


@JsonSerializable(fieldRename: FieldRename.none)
class Consultation {
  final int? id;
  final int? pid;
  final int? did;
  final bool? status;
  final int? rating;

  const Consultation({
    this.id,
    this.pid,
    this.did,
    this.status,
    this.rating,
  });

  factory Consultation.fromJson(Map<String, dynamic> json) =>
      _$ConsultationFromJson(json);

  Map<String, dynamic> toJson() => _$ConsultationToJson(this);

  Consultation copyWith({
    int? id,
    int? pid,
    int? did,
    bool? status,
    int? rating,
  }) {
    return Consultation(
      id: id ?? this.id,
      pid: pid ?? this.pid,
      did: did ?? this.did,
      status: status ?? this.status,
      rating: rating ?? this.rating,
    );
  }
}
